using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace UrduCtrl
{
	/// <summary>
	/// Summary description for UrduTextListEditorForm.
	/// </summary>
	public class UrduTextListEditorForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnOk;
		private System.Windows.Forms.Button btnCancel;
		private string[] m_sList;
		private UrduCtrl.UrduTextBox txtListItems;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public UrduTextListEditorForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.txtListItems = new UrduCtrl.UrduTextBox();
			this.btnOk = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// txtListItems
			// 
			this.txtListItems.Font = new System.Drawing.Font("Urdu Naskh Asiatype", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
			this.txtListItems.Location = new System.Drawing.Point(0, 0);
			this.txtListItems.Multiline = true;
			this.txtListItems.Name = "txtListItems";
			this.txtListItems.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
			this.txtListItems.ScrollBars = System.Windows.Forms.ScrollBars.Both;
			this.txtListItems.Size = new System.Drawing.Size(328, 256);
			this.txtListItems.TabIndex = 0;
			this.txtListItems.Text = "urduTextBox1";
			// 
			// btnOk
			// 
			this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.btnOk.Location = new System.Drawing.Point(240, 272);
			this.btnOk.Name = "btnOk";
			this.btnOk.Size = new System.Drawing.Size(80, 32);
			this.btnOk.TabIndex = 1;
			this.btnOk.Text = "Ok";
			this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.Location = new System.Drawing.Point(8, 272);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(72, 32);
			this.btnCancel.TabIndex = 2;
			this.btnCancel.Text = "Cancel";
			// 
			// UrduTextListEditorForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(328, 309);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnOk);
			this.Controls.Add(this.txtListItems);
			this.Name = "UrduTextListEditorForm";
			this.Text = "UrduTextListEditorForm";
			this.ResumeLayout(false);

		}
		#endregion

		private void btnOk_Click(object sender, System.EventArgs e)
		{
			//m_sList= (ListBox.ObjectCollection) this.txtListItems.Lines;
			//MessageBox.Show(this.txtListItems.Lines[0]);
			//m_sList.AddRange(this.txtListItems.Lines);
			m_sList= this.txtListItems.Lines;
			//MessageBox.Show((string) m_sList[0]);
		}

		public string[]  Lines
		{
			get
			{
				return m_sList;
			}

			set
			{
//				ArrayList larray= new ArrayList((ListBox.ObjectCollection) value);
//				this.txtListItems.Lines = (string[]) larray.ToArray(typeof(string));
//				m_sList= (ListBox.ObjectCollection) value;

				this.txtListItems.Lines = value;
				m_sList= value;
			}
		}
	}
}
